import {useEnterpriseStore} from "@/store/enterprise";
import {useUserStore} from "@/store/user";

export const getUserInfo = () => {
    const userStore = useUserStore()
    return userStore.userInfo;
}
export const getUserId = () => {
    const userStore = useUserStore()
    return userStore.userInfo.id;
}
export const getToken = ()=>{
    const userStore = useUserStore()
    return userStore.token;
}
export const getEnterpriseId = ()=>{
    const store = useEnterpriseStore()
    return store.enterprise.id;
}
export function isUserLoggedIn(): boolean {
   return getUserId() && getToken();
}
export const permissions = ()=>{
    const userStore = useUserStore()
    return userStore.userInfo.permissions;
}
export function hasUserPermission(key:string): boolean {
    return true
}